/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainPageProto.java
 *
 * Created on 07 18, 12, 2:19:57 PM
 */
package Display;

import javax.swing.JOptionPane;

/**
 *
 * @author Aeron
 */
public class MainPageFinal extends javax.swing.JFrame {

    /** Creates new form MainPageProto */
    public MainPageFinal() {
        initComponents();
        this.setSize(805,600);
        this.setResizable(false);
        this.setBounds(425, 70, 805, 570);
        
        jLabelWelcome.setText(malateproject.MalateProject.getMem().getFirstName());
        setMemberDetails();
        
        if (new DBM.DBManager().isEditor(malateproject.MalateProject.getMem().getIdNo()))
            admin.setVisible(true);
        else
            admin.setVisible(false);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTextField1 = new javax.swing.JTextField();
        jTextField2 = new javax.swing.JTextField();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTableReminders = new javax.swing.JTable();
        jLabel3 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        PassPanel = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jPasswordField1 = new javax.swing.JPasswordField();
        jPasswordField2 = new javax.swing.JPasswordField();
        jPasswordField3 = new javax.swing.JPasswordField();
        jPanel5 = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        LastNameText = new javax.swing.JTextField();
        IdText = new javax.swing.JTextField();
        ContactText = new javax.swing.JTextField();
        EmailText = new javax.swing.JTextField();
        StatusText = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        FirstNameText = new javax.swing.JTextField();
        MiddleNameText = new javax.swing.JTextField();
        CourseText = new javax.swing.JTextField();
        CollegeText = new javax.swing.JTextField();
        EditBut = new javax.swing.JButton();
        CancelBut = new javax.swing.JButton();
        Background = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        browseborrow = new javax.swing.JButton();
        liblogs = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        overduefee = new javax.swing.JTextField();
        returnbook = new javax.swing.JButton();
        renewbook = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        booktable = new javax.swing.JTable();
        jLabel5 = new javax.swing.JLabel();
        logout = new javax.swing.JButton();
        admin = new javax.swing.JButton();
        jLabelWelcome = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();

        jTextField1.setText("jTextField1");

        jTextField2.setText("jTextField2");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(null);

        jTabbedPane1.setFont(new java.awt.Font("Garamond", 0, 14));
        jTabbedPane1.setMinimumSize(new java.awt.Dimension(660, 660));

        jPanel1.setLayout(null);

        jTableReminders.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(jTableReminders);

        jPanel1.add(jScrollPane2);
        jScrollPane2.setBounds(60, 10, 570, 280);

        jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/MalateBG.E-res.jpg"))); // NOI18N
        jPanel1.add(jLabel3);
        jLabel3.setBounds(-3, -8, 700, 340);

        jTabbedPane1.addTab("Reminders", jPanel1);

        jPanel2.setLayout(null);

        jPanel4.setOpaque(false);

        PassPanel.setBackground(new java.awt.Color(102, 102, 102));
        PassPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Password :", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Garamond", 1, 14), new java.awt.Color(255, 255, 255))); // NOI18N
        PassPanel.setFont(new java.awt.Font("Times New Roman", 1, 12));
        PassPanel.setOpaque(false);

        jLabel12.setFont(new java.awt.Font("Garamond", 1, 14));
        jLabel12.setForeground(new java.awt.Color(255, 255, 255));
        jLabel12.setText("Old Password :");

        jLabel11.setFont(new java.awt.Font("Garamond", 1, 14));
        jLabel11.setForeground(new java.awt.Color(255, 255, 255));
        jLabel11.setText("New Password :");

        jLabel10.setFont(new java.awt.Font("Garamond", 1, 14));
        jLabel10.setForeground(new java.awt.Color(255, 255, 255));
        jLabel10.setText("Confirm Password :");

        jPasswordField1.setEditable(false);

        jPasswordField2.setEditable(false);

        jPasswordField3.setEditable(false);

        javax.swing.GroupLayout PassPanelLayout = new javax.swing.GroupLayout(PassPanel);
        PassPanel.setLayout(PassPanelLayout);
        PassPanelLayout.setHorizontalGroup(
            PassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PassPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(PassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel10)
                    .addComponent(jLabel11)
                    .addComponent(jLabel12))
                .addGap(18, 18, 18)
                .addGroup(PassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPasswordField3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE)
                    .addComponent(jPasswordField2, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPasswordField1, javax.swing.GroupLayout.Alignment.LEADING))
                .addContainerGap(24, Short.MAX_VALUE))
        );
        PassPanelLayout.setVerticalGroup(
            PassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PassPanelLayout.createSequentialGroup()
                .addGroup(PassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(PassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jPasswordField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(7, 7, 7)
                .addGroup(PassPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(jPasswordField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel5.setBackground(new java.awt.Color(255, 255, 255));
        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Basic Information :", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Garamond", 0, 14), new java.awt.Color(255, 255, 255))); // NOI18N
        jPanel5.setForeground(new java.awt.Color(255, 255, 255));
        jPanel5.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jPanel5.setOpaque(false);

        jLabel16.setFont(new java.awt.Font("Garamond", 0, 14));
        jLabel16.setForeground(new java.awt.Color(255, 255, 255));
        jLabel16.setText("Name :");

        jLabel17.setFont(new java.awt.Font("Garamond", 0, 14));
        jLabel17.setForeground(new java.awt.Color(255, 255, 255));
        jLabel17.setText("ID No# :");

        jLabel14.setFont(new java.awt.Font("Garamond", 0, 14));
        jLabel14.setForeground(new java.awt.Color(255, 255, 255));
        jLabel14.setText("Contact No :");

        jLabel15.setFont(new java.awt.Font("Garamond", 0, 14));
        jLabel15.setForeground(new java.awt.Color(255, 255, 255));
        jLabel15.setText("E-Mail Address :");

        jLabel18.setFont(new java.awt.Font("Garamond", 0, 14));
        jLabel18.setForeground(new java.awt.Color(255, 255, 255));
        jLabel18.setText("Status :");

        LastNameText.setEditable(false);
        LastNameText.setEnabled(false);

        IdText.setEditable(false);
        IdText.setEnabled(false);

        ContactText.setEditable(false);

        EmailText.setEditable(false);

        StatusText.setEditable(false);
        StatusText.setEnabled(false);

        jLabel13.setFont(new java.awt.Font("Garamond", 0, 14));
        jLabel13.setForeground(new java.awt.Color(255, 255, 255));
        jLabel13.setText("Course :");

        jLabel20.setFont(new java.awt.Font("Garamond", 0, 14));
        jLabel20.setForeground(new java.awt.Color(255, 255, 255));
        jLabel20.setText("College :");

        FirstNameText.setEditable(false);
        FirstNameText.setText("jTextField3");

        MiddleNameText.setEditable(false);
        MiddleNameText.setText("jTextField4");

        CourseText.setEditable(false);
        CourseText.setText("jTextField5");

        CollegeText.setEditable(false);
        CollegeText.setText("jTextField6");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addGap(40, 40, 40)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel16)
                    .addComponent(jLabel14))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(ContactText, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
                    .addComponent(LastNameText, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(FirstNameText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(MiddleNameText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(268, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel17)
                        .addGap(18, 18, 18)
                        .addComponent(IdText, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(229, 229, 229))))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel18)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(StatusText, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE)
                        .addGap(47, 47, 47)
                        .addComponent(jLabel20)
                        .addGap(18, 18, 18)
                        .addComponent(CollegeText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(EmailText, javax.swing.GroupLayout.DEFAULT_SIZE, 227, Short.MAX_VALUE)
                        .addGap(47, 47, 47)
                        .addComponent(jLabel13)
                        .addGap(18, 18, 18)
                        .addComponent(CourseText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(225, 225, 225))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(LastNameText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(FirstNameText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(MiddleNameText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel17)
                        .addComponent(IdText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel14)
                        .addComponent(ContactText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(EmailText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13)
                    .addComponent(CourseText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(StatusText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(CollegeText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        EditBut.setText("Edit");
        EditBut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EditButActionPerformed(evt);
            }
        });

        CancelBut.setText("Cancel");
        CancelBut.setEnabled(false);
        CancelBut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CancelButActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap(131, Short.MAX_VALUE)
                .addComponent(PassPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(61, 61, 61)
                .addComponent(EditBut, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(CancelBut, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(149, 149, 149))
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(68, 69, Short.MAX_VALUE)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(EditBut, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(CancelBut, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(43, 43, 43))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(PassPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );

        jPanel2.add(jPanel4);
        jPanel4.setBounds(0, 1, 680, 330);

        Background.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/MalateBG.E-res.jpg"))); // NOI18N
        jPanel2.add(Background);
        Background.setBounds(0, -10, 680, 340);

        jTabbedPane1.addTab("Account", jPanel2);

        jPanel3.setLayout(null);

        browseborrow.setText("Browse/Borrow");
        browseborrow.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                browseborrowActionPerformed(evt);
            }
        });
        jPanel3.add(browseborrow);
        browseborrow.setBounds(60, 90, 150, 40);

        liblogs.setBackground(new java.awt.Color(255, 255, 255));
        liblogs.setText("View Library Logs");
        liblogs.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                liblogsActionPerformed(evt);
            }
        });
        jPanel3.add(liblogs);
        liblogs.setBounds(60, 40, 150, 40);

        jLabel7.setFont(new java.awt.Font("Garamond", 1, 14));
        jLabel7.setForeground(new java.awt.Color(255, 255, 255));
        jLabel7.setText("Your Overdue Fee:  P");
        jPanel3.add(jLabel7);
        jLabel7.setBounds(30, 260, 140, 30);

        overduefee.setText("0.00");
        overduefee.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                overduefeeActionPerformed(evt);
            }
        });
        jPanel3.add(overduefee);
        overduefee.setBounds(170, 260, 90, 30);

        returnbook.setText("Return Book");
        returnbook.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                returnbookActionPerformed(evt);
            }
        });
        jPanel3.add(returnbook);
        returnbook.setBounds(60, 190, 150, 40);

        renewbook.setText("Renew Book");
        renewbook.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                renewbookActionPerformed(evt);
            }
        });
        jPanel3.add(renewbook);
        renewbook.setBounds(60, 140, 150, 40);

        jLabel8.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel8.setForeground(new java.awt.Color(255, 255, 255));
        jLabel8.setText("Your/Currently borrowed Books");
        jPanel3.add(jLabel8);
        jLabel8.setBounds(370, 0, 300, 30);

        booktable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"aaaaa", null, null, null},
                {"bbbbb", null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title", "Author", "Genre", "Date Borrowed"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jScrollPane1.setViewportView(booktable);

        jPanel3.add(jScrollPane1);
        jScrollPane1.setBounds(270, 30, 400, 260);

        jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/MalateBG.E-res.jpg"))); // NOI18N
        jPanel3.add(jLabel5);
        jLabel5.setBounds(-10, -10, 690, 320);

        jTabbedPane1.addTab("Library", jPanel3);

        getContentPane().add(jTabbedPane1);
        jTabbedPane1.setBounds(60, 150, 680, 370);

        logout.setText("Logout");
        logout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                logoutActionPerformed(evt);
            }
        });
        getContentPane().add(logout);
        logout.setBounds(630, 50, 120, 40);

        admin.setText("Administrator");
        admin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                adminActionPerformed(evt);
            }
        });
        getContentPane().add(admin);
        admin.setBounds(630, 110, 120, 40);

        jLabelWelcome.setFont(new java.awt.Font("Garamond", 1, 28));
        jLabelWelcome.setForeground(new java.awt.Color(255, 255, 255));
        jLabelWelcome.setText("Welcome, <name>");
        getContentPane().add(jLabelWelcome);
        jLabelWelcome.setBounds(350, 40, 290, 50);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/MalateBG.E-res.jpg"))); // NOI18N
        getContentPane().add(jLabel1);
        jLabel1.setBounds(0, 0, 800, 600);

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void logoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logoutActionPerformed
// TODO add your handling code here:
    this.setVisible(false);
    new MainPageFinal().setVisible(true); 
}//GEN-LAST:event_logoutActionPerformed

private void overduefeeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_overduefeeActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_overduefeeActionPerformed

    private void adminActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_adminActionPerformed
        // TODO add your handling code here:
        this.setVisible(false);
        new AdminPageFinal().setVisible(true);
    }//GEN-LAST:event_adminActionPerformed

    private void liblogsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_liblogsActionPerformed
        // TODO add your handling code here:
        this.setVisible(false);
        new LogsPageFinal().setVisible(true);
                
    }//GEN-LAST:event_liblogsActionPerformed

    private void browseborrowActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseborrowActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_browseborrowActionPerformed

    private void returnbookActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_returnbookActionPerformed
        // TODO add your handling code here:
        
        //nageeror kapag null value ung laman ng table so assume n lng ntin na may laman?
        
        int row = booktable.getSelectedRow();
        String getbook = (String) booktable.getValueAt(0, row);
        
      int reply = JOptionPane.showConfirmDialog(null, "", "Are you sure you want to return this book?", JOptionPane.YES_NO_CANCEL_OPTION);
       
      if(reply == JOptionPane.YES_OPTION)
      {
        //database part
          
         JOptionPane.showMessageDialog(null, "Book is returned successfully.");
      }
    
    }//GEN-LAST:event_returnbookActionPerformed

    private void renewbookActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_renewbookActionPerformed
        // TODO add your handling code here:
             //check if table has selected value
   
        //nageeror kapag null value ung laman ng table so assume n lng ntin na may laman?
       int row = booktable.getSelectedRow();
        String getbook = (String) booktable.getValueAt(0, row);
        
        
      int reply = JOptionPane.showConfirmDialog(null, "", "Are you sure you want to return this book?", JOptionPane.YES_NO_CANCEL_OPTION);
       
      if(reply == JOptionPane.YES_OPTION)
      {
        //database part
          
         JOptionPane.showMessageDialog(null, "Book is returned successfully.");
      }
        
    }//GEN-LAST:event_renewbookActionPerformed

    private void EditButActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EditButActionPerformed
        boolean bool;
        Objects.Member editMem = malateproject.MalateProject.getMem();
        
        if (LastNameText.isEditable()) {
            bool = false;
            EditBut.setText("Edit");
            
            editMem.setCollege(CollegeText.getText());
            editMem.setContactNo(ContactText.getText());
            editMem.setCourse(CourseText.getText());
            //editMem.setDateOfBirth(null);
            editMem.setEmailAd(EmailText.getText());
            editMem.setFirstName(FirstNameText.getText());
            editMem.setLastName(LastNameText.getText());
            editMem.setMiddleName(MiddleNameText.getText());
            //editMem.setPassword(null);
            
            if (jPasswordField1.getText().length() > 0) {
                if (jPasswordField1.getText() == editMem.getPassword()) {
                    if (jPasswordField2.getText() == jPasswordField3.getText())
                        editMem.setPassword(jPasswordField2.getText());
                }
            }
            
            new DBM.DBManager().updateMember(editMem);
        }
        else {
            bool = true;
            EditBut.setText("Done");
        }
            
        setFieldsEditable(bool);
        CancelBut.setEnabled(bool);
    }//GEN-LAST:event_EditButActionPerformed

    private void CancelButActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CancelButActionPerformed
        setMemberDetails();
        setFieldsEditable(false);
        this.setEnabled(false);
    }//GEN-LAST:event_CancelButActionPerformed

    
    /**/
    private void setMemberDetails() {
        LastNameText.setText(malateproject.MalateProject.getMem().getLastName());
        FirstNameText.setText(malateproject.MalateProject.getMem().getFirstName());
        MiddleNameText.setText(malateproject.MalateProject.getMem().getMiddleName());
        ContactText.setText(malateproject.MalateProject.getMem().getContactNo());
        EmailText.setText(malateproject.MalateProject.getMem().getEmailAd());
        StatusText.setText(malateproject.MalateProject.getMem().getStatus());
        IdText.setText(malateproject.MalateProject.getMem().getIdNo());
        CourseText.setText(malateproject.MalateProject.getMem().getCourse());
        CollegeText.setText(malateproject.MalateProject.getMem().getCollege());
    }
    
    
    /**/
    private void setFieldsEditable(boolean bool) {
        LastNameText.setEditable(bool);
        FirstNameText.setEditable(bool);
        MiddleNameText.setEditable(bool);
        ContactText.setEditable(bool);
        EmailText.setEditable(bool);
        CourseText.setEditable(bool);
        CollegeText.setEditable(bool);
        jPasswordField1.setEditable(bool);
        jPasswordField2.setEditable(bool);
        jPasswordField3.setEditable(bool);
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainPageFinal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainPageFinal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainPageFinal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainPageFinal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new MainPageFinal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel Background;
    private javax.swing.JButton CancelBut;
    private javax.swing.JTextField CollegeText;
    private javax.swing.JTextField ContactText;
    private javax.swing.JTextField CourseText;
    private javax.swing.JButton EditBut;
    private javax.swing.JTextField EmailText;
    private javax.swing.JTextField FirstNameText;
    private javax.swing.JTextField IdText;
    private javax.swing.JTextField LastNameText;
    private javax.swing.JTextField MiddleNameText;
    private javax.swing.JPanel PassPanel;
    private javax.swing.JTextField StatusText;
    private javax.swing.JButton admin;
    private javax.swing.JTable booktable;
    private javax.swing.JButton browseborrow;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabelWelcome;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPasswordField jPasswordField1;
    private javax.swing.JPasswordField jPasswordField2;
    private javax.swing.JPasswordField jPasswordField3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable jTableReminders;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JButton liblogs;
    private javax.swing.JButton logout;
    private javax.swing.JTextField overduefee;
    private javax.swing.JButton renewbook;
    private javax.swing.JButton returnbook;
    // End of variables declaration//GEN-END:variables
}
